/**
 * @author MIAO
 * Created on 2011-10-31
 * For more information, please visit:ismiao.com
 */
package com.ismiao.example.hbm;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class QueryCustomer {
	public static void main(String[] args) {  
        Configuration conf = new Configuration().configure();  
        SessionFactory sf = conf.buildSessionFactory();  
        Session session = sf.openSession();  
        Customer cst = (Customer)session.get(Customer.class, 6);  
        int id = cst.getId();  
        String name = cst.getName();  
        String psd = cst.getPassword();  
        System.out.println("ID号:" + id);  
        System.out.println("姓名:" + name);  
        System.out.println("性别:" + psd);  
        //关闭session  
        session.close();  
    } 
}
